home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility2 / wine02bx.zip / LISP / PACKAGES / SERVER.ELC < prev    next >
Text File  |  1993-03-28  |  6KB  |  73 lines

  1. ;;; compiled by jwz@thalidomide on Sat Jan 16 01:47:01 1993
  2. ;;; from file /cadillac-th/jwz/emacs19/lisp/packages/server.el
  3. ;;; emacs version 19.4.1 Lucid.
  4. ;;; bytecomp version 2.09; 12-jan-93.
  5. ;;; optimization is on.
  6. ;;; this file uses opcodes which do not exist in Emacs18.
  7.  
  8. (if (and (boundp 'emacs-version)
  9.      (or (and (boundp 'epoch::version) epoch::version)
  10.          (string-lessp emacs-version "19")))
  11.     (error "This file was compiled for Emacs19."))
  12.  
  13. (defvar server-program "emacsserver" "\
  14. *The program to use as the edit server")
  15. (defvar server-visit-hook nil "\
  16. *List of hooks to call when switching to a buffer for the Emacs server.")
  17. (defvar server-process nil "\
  18. the current server process")
  19. (defvar server-clients nil "\
  20. List of current server clients.
  21. Each element is (CLIENTID FILES...) where CLIENTID is a string
  22. that can be given to the server process to identify a client.
  23. When a buffer is marked as \"done\", it is removed from this list.")
  24. (defvar server-buffer-clients nil "\
  25. List of clientids for clients requesting editing of current buffer.")
  26. (put 'server-buffer-clients 'permanent-local t)
  27. (defvar server-temp-file-regexp "^/tmp/Re\\|/draft$" "\
  28. *Regexp which should match filenames of temporary files
  29. which are deleted and reused after each edit
  30. by the programs that invoke the emacs server.")
  31. (byte-code "└┴!ê┬┴├\"ê┴ ₧¼ä┼ B╞╟Mê╚╔Mç" [make-variable-buffer-local server-buffer-clients set-default nil minor-mode-alist (server-buffer-clients " Server") server-log #[(string) "└┴!¡Éè┴qêdbê\ncêo«é├ )ç" [get-buffer "*server*" string newline] 2] server-sentinel #[(proc msg) "└    !┬=½å├─┼!!ç└    !╞=¡à├─╟!!ç" [process-status proc exit server-log message "Server subprocess exited" signal "Server subprocess killed"] 3]] 3)
  32. (fset 'server-start #[(&optional leave-dead) "½è┴┬\"ê┬├─Åê┬┼╞Åê½Å@A@╔!ê)¬m\n?¡¥½å╦╠═!!ê╬╧┬#┴╤\"ê╥╙\"ê╘!ç" [server-process set-process-sentinel nil (delete-process server-process) ((error)) (delete-file "~/.emacs_server") ((error)) server-clients buffer server-buffer-done leave-dead server-log message "Restarting server" start-process "server" server-program server-sentinel set-process-filter server-process-filter process-kill-without-query] 4 "\
  33. Allow this Emacs process to be a server for client processes.
  34. This starts a server communications subprocess through which
  35. client \"editors\" can send your editing commands to this Emacs job.
  36. To use the server, set up the program `etc/emacsclient' in the
  37. Emacs distribution as your standard \"editor\".
  38.  
  39. Prefix arg means just kill any existing server communications subprocess." "P"])
  40. (fset 'server-process-filter #[(proc string) "└    !ê┬├    \"─=??¡≤    ─ò┼Oë─┬╞    \"OC┼╟    \n    ─ò┼O┬╦    \"½▒    ─ö─òSO     ─ò┼O┬═ \"½ï╬ ╟┼O!¬ì D    B    ╟)¬I╧    \n\"ê\nB╤\nA@!ê╥╙ !ê╘╒╓!!+ç" [server-log string string-match "Client: " 0 nil " " 1 lineno files client "[^ ]+ " arg "\\`\\+[0-9]+\\'" read server-visit-files server-clients switch-to-buffer make-screen-visible selected-screen message substitute-command-keys "When done with a buffer, type \\[server-edit]."] 6])
  41. (fset 'server-visit-files #[(files client) "└\n½╪è\n@@─ !뽿q½ñ╞ !½æ╟!½à╚!½₧╔╩└\"ê¬ù╦╠ ═Q!½Å╬ !ê¬ë╧ !qê╨╤!ê*╥\n@A@!ê@Bp    B)\nAë¼(    ñ)ç" [nil client-record files filen get-file-buffer obuf file-exists-p verify-visited-file-modtime buffer-modified-p revert-buffer t y-or-n-p "File no longer exists: " ", write buffer to file? " write-file find-file-noselect run-hooks server-visit-hook goto-line client server-buffer-clients] 5 "\
  42. Finds FILES and returns the list CLIENT with the buffers nconc'd.
  43. FILES is an alist whose elements are (FILENAME LINENUMBER)."])
  44. (fset 'server-buffer-done #[(buffer) "└    !┬=├ ½┴@¼ë    >A@╩    \"êA¼¥½ô╦    ╠═@\"\"ê╬╠═@\"!ê╩ \")Aë¼?╧    !½ëè    qê├)╤    !ê+ç" [process-status server-process run nil server-clients old-clients next-buffer running client buffer delq send-string format "Close: %s Done\n" server-log buffer-name server-buffer-clients bury-buffer] 6 "\
  45. Mark BUFFER as \"done\" for its client(s).
  46. Buries the buffer, and returns another server buffer
  47. as a suggestion for what to select next."])
  48. (fset 'server-temp-file-p #[(buffer) "└    !¡å┬ └    !\"ç" [buffer-file-name buffer string-match server-temp-file-regexp] 4 "\
  49. Return non-nil if BUFFER contains a file considered temporary.
  50. These are files whose names suggest they are repeatedly
  51. reused to pass information to another program.
  52.  
  53. The variable `server-temp-file-regexp' controls which filenames
  54. are considered temporary."])
  55. (fset 'server-done #[nil "p    ¡⌐┬!½æ├ ê─ed╞P#ê╟!ê¬É╚ ½î╔╩╦Q!½ä├!ê╠!)ç" [buffer server-buffer-clients server-temp-file-p save-buffer write-region buffer-file-name "~" kill-buffer buffer-modified-p y-or-n-p "Save file " "? " server-buffer-done] 5 "\
  56. Offer to save current buffer, mark it as \"done\" for clients,
  57. bury it, and return a suggested buffer to select next."])
  58. (fset 'server-edit #[(&optional arg) "¼è    ½ç┬    !├>½ä─┼!ç╞╟ !ç" [arg server-process process-status (signal exit) server-start nil server-switch-buffer server-done] 2 "\
  59. Switch to next server editing buffer; say \"Done\" for current buffer.
  60. If a server buffer is current, it is marked \"done\" and optionally saved.
  61. When all of a client's buffers are marked as \"done\", the client is notified.
  62.  
  63. Temporary files such as MH <draft> files are always saved and backed up,
  64. no questions asked.  The variable `server-temp-file-regexp' controls
  65. which filenames are considered temporary.
  66.  
  67. If invoked with a prefix argument, or if there is no server process running, 
  68. starts server process and that is all.  Invoked by \\[server-edit]." "P"])
  69. (fset 'server-switch-buffer #[(next-buffer) "½ö┴!½ë┬!½ä├!ç─┼!!ç½ê─@A@!ç├╟ !ç" [next-buffer bufferp buffer-name switch-to-buffer server-switch-buffer server-buffer-done server-clients other-buffer] 3 "\
  70. Switch to another buffer, preferably one that has a client.
  71. Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."])
  72. (global-set-key "#" 'server-edit)
  73.